﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using FileCommon.Models;

namespace FileEfCore.FileInfo;

[Table("UploadFiles")]
public class UploadFile
{
    [Key]
    [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
    public long Id { get; set; }

    [Column(TypeName = "varchar(1000)")]
    [Required]
    public string LocalFileName { get; set; }

    [Column(TypeName = "varchar(1000)")]
    [Required]
    public string ServerFileName { get; set; }

    [Required]
    public OperationType OperationType { get; set; }

    [Required]
    public DateTime OperationDateTime { get; set; }

    public double ProgressRate { get; set; }

    public long FileLength { get; set; }

    [Required]
    public ProgressStatus ProgressStatus { get; set; }

    public DateTime LastUpdateTime { get; set; }
    
    public string? Remark { get; set; }
    
    [Required]
    public string MD5Hash { get; set; }
    
}